<template>
  <div>我是About</div>
</template>
<script>
//引入项目中的实例router
import router from '../router'
//引入Vue-Router为我们提供的useRouter方法
import { useRoute } from 'vue-router'
export default{
  name: 'About',
  setup() {
    //方式1：通过useRoute方法获取查询参数对象
    const { query: query1 } = useRoute()
    //方式2：通过实例router获取查询参数对象
    const { query: query2 } = router.currentRoute.value 
    //分别打印它们
    console.log('query1', query1)
    console.log('query2', query2)
  }
}
</script>